from selenium import webdriver
from selenium.webdriver.common.by import By
# 异常模块
from selenium.common import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
def search():
    try:
        WebDriverWait(driver,10).until(EC.presence_of_element_located((By.ID,"")))
    except TimeoutException:
        return search()